package edu.hawaii.myisern.action;

import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.action.RedirectResolution;

/**
 * Handles user logout from MyIsern system.
 * Modeled after the Bugzooky example.
 * 
 * @author Tim Fennell
 * @author Lisa Chen
 *
 */
public class LogoutActionBean extends IsernActionBean {

  /**
   * Invalidate the session and redirect the user to logout jsp.
   * 
   * @return logout.jsp Redirected page after session is Invalidated.
   * @throws Exception if something goes wrong.
   */
  public Resolution logout() throws Exception {
    getContext().getRequest().getSession().invalidate();
    return new RedirectResolution("/logout.jsp");
  }
}
